//
//  PriceOffTableViewCell.m
//  A段项目
//
//  Created by dlios on 15/7/20.
//  Copyright (c) 2015年 dlios. All rights reserved.
//

#import "PriceOffTableViewCell.h"
#import "BaseHeader.h"


@implementation PriceOffTableViewCell

- (void)dealloc
{
    [super dealloc];
}


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self createSubviews];
        self.selectionStyle = UITableViewCellSelectionStyleNone;
    }
    return self;
}

- (void)createSubviews
{
    self.name = [[UILabel alloc] initWithFrame:CGRectMake(5, 20, ScreenWidth / 3 * 2, 50)];
    _name.numberOfLines = 0;
    [self addSubview:_name];
    [_name release];
    
    self.DealerName = [[UILabel alloc] initWithFrame:CGRectMake(5, _name.frame.size.height + 30, ScreenWidth / 4, 20)];
    _DealerName.textColor = [UIColor grayColor];
    _DealerName.font = [UIFont systemFontOfSize:12];
    [self addSubview:_DealerName];
    [_DealerName release];
    
    self.StoreState = [[UILabel alloc] initWithFrame:CGRectMake(_DealerName.frame.size.width + _DealerName.frame.origin.x, _DealerName.frame.origin.y, 50, 20)];
    _StoreState.textColor = [UIColor grayColor];
    _StoreState.font = [UIFont systemFontOfSize:12];
    _StoreState.layer.borderWidth = 1;
    _StoreState.layer.borderColor = [UIColor lightGrayColor].CGColor;
    [self addSubview:_StoreState];
    [_StoreState release];
    
    self.SaleRegion = [[UILabel alloc] initWithFrame:CGRectMake(_StoreState.frame.size.width + _StoreState.frame.origin.x + 10, _DealerName.frame.origin.y, 26, 20)];
    _SaleRegion.textColor = [UIColor grayColor];
    _SaleRegion.font = [UIFont systemFontOfSize:12];
    _SaleRegion.layer.borderWidth = 1;
    _SaleRegion.layer.borderColor = [UIColor lightGrayColor].CGColor;
    [self addSubview:_SaleRegion];
    [_SaleRegion release];
    
    self.ActPrice = [[UILabel alloc] initWithFrame:CGRectMake(ScreenWidth - 70, _name.frame.origin.y, 70, 20)];
    _ActPrice.textColor = [UIColor redColor];
    _ActPrice.font = [UIFont systemFontOfSize:15];
    [self addSubview:_ActPrice];
    [_ActPrice release];
    
    self.ReferPrice = [[UILabel alloc] initWithFrame:CGRectMake(_ActPrice.frame.origin.x + 5, _ActPrice.frame.origin.y + 30, 70, 20)];
    _ReferPrice.textColor = [UIColor grayColor];
    _ReferPrice.font = [UIFont systemFontOfSize:13];
    [self addSubview:_ReferPrice];
    [_ReferPrice release];
    
    UILabel *lab = [[UILabel alloc] initWithFrame:CGRectMake(_ActPrice.frame.origin.x + 5, _ActPrice.frame.origin.y + 40, 55, 1)];
    lab.backgroundColor = [UIColor grayColor];
    [self addSubview:lab];
    [lab release];
    
    UIImageView *image = [[UIImageView alloc] initWithFrame:CGRectMake(_ActPrice.frame.origin.x, _ReferPrice.frame.origin.y + 30, 30, 20)];
    image.image = [UIImage imageNamed:@"13.png"];
    [self addSubview:image];
    [image release];
    
    self.FavPrice = [[UILabel alloc] initWithFrame:CGRectMake(image.frame.origin.x + 20, image.frame.origin.y, 70, 20)];
    _FavPrice.textColor = [UIColor greenColor];
    _FavPrice.font = [UIFont systemFontOfSize:13];
    [self addSubview:_FavPrice];
    [_FavPrice release];
    
    self.CallCenterNumber = [[UIButton alloc] initWithFrame:CGRectMake(5, _FavPrice.frame.origin.y + 30, (ScreenWidth - 20) / 2, 35)];
    [_CallCenterNumber setTitleColor:[UIColor greenColor] forState:UIControlStateNormal];
    [_CallCenterNumber setImage:[UIImage imageNamed:@"12.png"] forState:UIControlStateNormal];
    _CallCenterNumber.layer.borderColor = [UIColor lightGrayColor].CGColor;
    _CallCenterNumber.layer.borderWidth = 1;
    _CallCenterNumber.titleLabel.font = [UIFont systemFontOfSize:15];
    [self addSubview:_CallCenterNumber];
    [_CallCenterNumber release];
    
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
